<?php
setlocale(LC_ALL, 'zh_CN.utf-8');
header("Content-Type:text/html;charset=utf-8");

$cate = isset($_GET['type']) ? $_GET['type'] : NULL;


require_once 'class/material.class.php';
require_once 'class/log.class.php';


$materialClass= new materialClass();
$logClass= new logClass();
$logClass->add($cate);

$total=$materialClass->getCount2($cate);



$data["total"] = $total;  

$items = $materialClass->getAll2($cate);
$topItems = $materialClass->getAll3($cate);

$data["top"] = $topItems; 
$data["item"] = $items;   
$json= json_encode($data); 
echo $json; 
?>